﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="ContractPGSPExpand_Tab.aspx.vb" Inherits="PubProject.ContractPGSPExpand_Tab" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<head runat="server">
    <title></title>
    	<script language="javascript" src="/_controls/settings.aspx"></script>
		<!-- Global -->
		<link rel="stylesheet" type="text/css" href="/_common/styles/global.css">
		<script language="javascript" src="/_common/scripts/global.js"></script>
		<!-- Menu -->
		<link rel="stylesheet" type="text/css" href="/_nav/menu.css">
		<script language="javascript" src="/_nav/menu.js"></script>
		<!-- Grid -->
		<link rel="stylesheet" type="text/css" href="/_grid/map_grid.css">
		<LINK href="/_controls/tree/gridtree.css" type="text/css" rel="stylesheet">
		<!-- Form -->
		<link rel="stylesheet" type="text/css" href="/_forms/styles/form.css">		
		<!-- Tab -->
		<link rel="stylesheet" type="text/css" href="/_nav/tabs.css">
		<!-- Utility-->
		<script language="javascript" src="/_controls/util/util.js"></script>
		
		<script language="javascript">
		    /*
		    * 功能：    界面初始化,主要的功能是标签页的加载
		    * 参数：    无
		    * 返回值：  无
		    * 创建人：  王涛
		    * 创建时间：2009-12-21
		    * 修改人：  王涛
		    * 修改时间：2010-02-26
		    */
		    function window.onload()
		    {
		        var strStepXML = parent.document.getElementById("txtStepXML").value;
		        if (strStepXML != "")
		        {
		            var xmlDom = new ActiveXObject("Microsoft.XMLDOM");
		            xmlDom.loadXML(strStepXML);
		            // 获取所有阶段
		            var xmlNode = xmlDom.selectNodes("/xml/Step");

		            // 如果少一个阶段,使用该字段+1
		            var iBen = 1;       //控制隐藏
		            var iEnd = 1;
		            for (var i = 0; i < xmlNode.length; i++)
		            {
		                // 如果不相等,表示少了阶段
		                while (xmlNode[i].selectSingleNode("StageCode").text * 1 != iBen)
		                {
		                    // 进行循环,直到有阶段后同步
		                    // 隐藏当前标签页
		                    document.getElementById("tabStep" + iBen).style.display = "none";
		                    // 指针加1,用于判断下一个标签页
		                    iBen++;
		                }

		                // 保存阶段GUID,用于传递给AppGrid
		                document.getElementById("tabStep" + iBen).stageGUID = xmlNode[i].selectSingleNode("StageGUID").text;
		                // 赋值标签页名称
		                document.getElementById("tabStep" + iBen).innerText = xmlNode[i].selectSingleNode("StepName").text;
		                // 判断当前阶段,并选中
		                if (xmlNode[i].selectSingleNode("IsShow").text == "1")
		                {
		                    document.getElementById("tabStep" + iBen).click();
		                }
		                // 指针加1,用于判断下一个标签页
		                iBen++;
		                // 当是最后一个阶段时,判断下一阶段是不是空,如果是空,隐藏后面的所有标签页
		                if (i == xmlNode.length - 1)
		                {
		                    var oSpan;
		                    for (var j = 0; j < 4 - iBen + 1; j++)
		                    {
		                        oSpan = document.getElementById("tabStep" + (iBen + j));
		                        if (oSpan)
		                        {
		                            oSpan.style.display = "none";
		                        }
		                    }
		                }
		            }
		        }
		        else
		        {
		            document.getElementById("tabStep1").style.display = "none";
		            document.getElementById("tabStep2").style.display = "none";
		            document.getElementById("tabStep3").style.display = "none";
		            document.getElementById("tabStep4").style.display = "none";
		        }
		    }

		    /*
		    * 功能：    点击标签页显示Grid
		    * 参数：    sType       - 阶段
		    * 返回值：  无
		    * 创建人：  王涛
		    * 创建时间：2009-12-29
		    * 修改人：  
		    * 修改时间：
		    */
		    function switchTabPage(sType)
		    {
		        var sParamList = "mode=3&num=" + Math.random();
		        switch (sType)
		        {
		            case "Step1":
		                if (document.all("ifrmStep1").src == "")
	                    {
	                        document.all("ifrmStep1").src = "ContractPGSPExpand_Grid.aspx?" + sParamList + "&StageCode=1";
	                    }
		                break;

		            case "Step2":
		                if (document.all("ifrmStep2").src == "")
	                    {
	                        document.all("ifrmStep2").src = "ContractPGSPExpand_Grid.aspx?" + sParamList + "&StageCode=2";
	                    }
		                break;
		            case "Step3":
		                if (document.all("ifrmStep3").src == "")
	                    {
	                        document.all("ifrmStep3").src = "ContractPGSPExpand_Grid.aspx?" + sParamList + "&StageCode=3";
	                    }
		                break;

		            case "Step4":
		                if (document.all("ifrmStep4").src == "")
	                    {
	                        document.all("ifrmStep4").src = "ContractPGSPExpand_Grid.aspx?" + sParamList + "&StageCode=4";
	                    }
		                break;
		            default:
		                break;
		        }
		    }
		</script>
</head>
<body  class="tab" style="PADDING-RIGHT:0px;PADDING-LEFT:0px;PADDING-BOTTOM:0px;WIDTH:100%;PADDING-TOP:0px" >
    <form id="form1" runat="server">
    <table  style="FONT-SIZE: 9pt" height="100%" cellSpacing="0" cellPadding="0" width="100%">
		<tr height="25">
			<td>
				<!-- 标签头 -->
				<table class="tabBar" cellSpacing="0" cellPadding="0" mode="noGlow">
					<tr>
						<td id="tabs" vAlign="bottom" noWrap>
							<span id="tabStep1" class="tab tabOn" tabIndex="0" tabID="tab0" onclick="switchTabPage('Step1',this.stageGUID)" stageGUID=""></span>
							<span id="tabStep2" class="tab" tabIndex="1" tabID="tab1" onclick="switchTabPage('Step2',this.stageGUID)" stageGUID=""></span>
							<span id="tabStep3" class="tab" tabIndex="2" tabID="tab2" onclick="switchTabPage('Step3',this.stageGUID)" stageGUID=""></span>
							<span id="tabStep4" class="tab" tabIndex="3" tabID="tab3" onclick="switchTabPage('Step4',this.stageGUID)" stageGUID=""></span>
						</td>
					</tr>
				</table>
				<hr class="tabGlow" id="hrSelectedTab" />
				<hr class="tabGlow" id="hrGlowTab" />
			</td>
		</tr>
		<tr>
			<td vAlign="top">
				<!-- 标签主体 -->
				<div class="tab" id="tab0" style="height:100%">
				    <table style="width:100%; height:100%;">
				        <tr>
				            <td valign="top">
					            <iframe style='WIDTH: 100%; HEIGHT: 100%' src='' scrolling='no' name='ifrmStep1' frameBorder='0'></iframe>
						    </td>
				        </tr>
				    </table>
				</div>
				<div class="tab" id="tab1">
				    <table style="width:100%; height:100%">
				        <tr>
				            <td valign="top">
				                <iframe style=' WIDTH: 100%; HEIGHT: 100%' src='' scrolling='no' id='ifrmStep2' frameBorder='0'></iframe>
						    </td>
				        </tr>
				    </table>
				</div>
				<div class="tab" id="tab2" >
				    <table style="width:100%; height:100%">
				        <tr>
				            <td valign="top">
						        <iframe style='WIDTH: 100%; HEIGHT: 100%' src='' scrolling='no' id='ifrmStep3' frameBorder='0'></iframe>
						    </td>
				        </tr>
				    </table>
				</div>
				<div class="tab" id="tab3" >
				    <table style="width:100%; height:100%">
				        <tr>
				            <td valign="top">
					            <iframe style='WIDTH: 100%; HEIGHT: 100%' src='' scrolling='no' id='ifrmStep4' frameBorder='0'></iframe>
						    </td>
				        </tr>
				    </table>
				</div>
			</td>
		</tr>
	</table>
    </form>
</body>
</html>
